#include "my_adc.h"
#include "Global.h"
#include "adc.h"



void MyAdc_Hardware_Config(void)
{
	ADC_InitTypeDef       ADC_InitStructure = {0};

	ADC_InitStructure.ADC_Mode = ADC_Mode_Select; //选择模式
	ADC_InitStructure.ADC_ConvSpeed = ADC_ConvSpeed_High; //高速变换模式
	ADC_InitStructure.ADC_Prescaler = ADC_Prescaler_Div32;//预分频
	ADC_InitStructure.ADC_RefVoltage = ADC_Ref_Vdd; //使用VDD参考电压
	ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrig_Software; //软件触发
	ADC_InitStructure.ADC_ContinuousConvMode = ADC_Conv_Oneshot;//开启连续转换
	ADC_InitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_4Cycles; 
	ADC_InitStructure.ADC_UpLimit = ADC_UpLimit_Setting; //adc采样高8位 采样比较最大值，默认值
	ADC_InitStructure.ADC_LowLimit = ADC_LowLimit_Setting; //adc采样高8位 采样比较最低值，默认值
	ADC_Init(&ADC_InitStructure);

//	ISR_Register(ADC_IRQn, adc_interrupt); //中断服务路径注册
}

